/**
Date: 2025-08-13
Copyright (c) 2025 CAX Conversion Project
*/
import { caxConvertInfoVO, caxConvertInfoQuery, caxConvertInfoForm } from '@/api/caxConversionPlatform/type';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
// 查询1.CAX格式转换记录
export const getCaxConvertInfoList = (query: caxConvertInfoQuery): AxiosPromise<caxConvertInfoVO[]> => {
  return request({
    url: '/cax/convert/list',
    method: 'get',
    params: query
  });
};

// 删除CAX格式转换记录
export const delCaxConvertInfo = (ids: string | number) => {
  return request({
    url: '/cax/convert/' + ids,
    method: 'delete'
  });
};
// CAX格式转换接口
export const caxConvertInfo = (data: FormData) => {
  return request({
    url: '/cax/convert',
    method: 'post',
    data: data,
    headers: {
      'Content-type': 'multipart/form-data'
    }
  });
};

// 2.查询CAX格式转换记录详情接口
export const getCaxConvertInfo = (id: string | number) => {
  return request({
    url: `/cax/convert/${id}`,
    method: 'get'
  });
};

// 下载CAX格式转换-源文件接口
export const downloadCaxSource = (id: string | number) => {
  return request({
    url: `/cax/convert/download/source/${id}`,
    method: 'get',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    responseType: 'blob'
  });
};

// 4.下载CAX格式转换-转换文件接口
export const downloadCaxTarget = (id: string | number) => {
  return request({
    url: `/cax/convert/download/target/${id}`,
    method: 'get',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    responseType: 'blob'
  });
};
